package Code.Test;

//需求：定义一个方法判断数组中的某一个数是否存在，将结果返回给调用处
public class Test3 {
    public static void main(String[] args) {

        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};

        int number1 = 6;
        int number2 = 12;
        System.out.println(Seek(number1, arr));
        System.out.println(Seek(number2, arr));
    }

    public static boolean Seek(int num, int[] arr) {

        for (int i = 0; i < arr.length; i++) {
            if (num == arr[i]) {
                return true;
            }
        }
        return false;
    }

}
